package com.dao;

import com.domain.Book;
import org.apache.ibatis.annotations.*;

import java.util.List;


public interface bookDao {

    @Insert("insert into tbl_book(type,name,description) values(#{type},#{name},#{description})")
    int add(Book book);

    @Delete("delete from tbl_book where id=#{id}")
    int delete(int id);

    @Update("update tbl_book set type=#{type},name=#{name},description=#{description} where id=#{id}")
    int update(Book book);


    @Select("select * from tbl_book where id = #{id}")
    Book getById(int id);

    @Select("select * from tbl_book")
    List<Book> getAll();

}
